class DefalutMap extends Map {
  constructor(defaultValue){
    super();
    this.defaultValue = defaultValue
  }
  get(key){
    if(this.has(key)){
      return super.get(key);
    }
    else {
      return this.defaultValue
    }
  }
  
}

// 
class Histogram {
  constructor() {
    this.letterCounts = new DefalutMap(0);
    this.totalLetters = 0
  }
  add(text){
    console.log(text)
    text = text.replace(/\s/g,"");
  
    for(let character of text){
      let count = this.letterCounts.get(character);
      this.letterCounts.set(character,count+1)
      this.totalLetters++
    }
  }
  toString(){
    let entries = [...this.letterCounts];

    entries.sort((a,b)=>{
      if(a[1] === b[1]){
        return a[0] < b[0]?-1:1
      }
      else {
        return b[1] - a[1]
      }
    })

    for(let entry of entries){
      entry[1] = entry[1] / this.totalLetters * 100;
    }

    entries = entries.filter(entry => entry[1] >= 1)

    let lines = entries.map(
      ([l,n])=>`${l}:${"#".repeat(Math.round(n))} ${n.toFixed(2)}%`
    )
    // console.log(lines)
    return lines.join('\n')
  }
}

// let H = new Histogram()
// H.add('sadsadsadasdsadasdasdsadsadsavxvsvbv')
// console.log(H.toString())

async function histogramFromStdin(){
  process.stdin.setEncoding('utf-8');
  let histogram = new Histogram();
  for await(let chunk of process.stdin){
    histogram.add(chunk)
  }
  return histogram
}

histogramFromStdin().then(his=>{
  console.log(his.toString())
})